import axios from 'axios'

export function request(config) {
  //创建axios实例
  const instance = axios.create({
    baseURL: `http://timemeetyou.com:8889/api/private/v1/`,
    timeout: 5000
  })
  //为请求头对象，添加 Token 验证的 Authorization字段
  instance.interceptors.request.use(config => {
    config.headers.Authorization = sessionStorage.getItem('token')
    return config
  })

  return instance(config)
}